var e = require;
var t = module;
var o = exports;
var n,
    i = o,
    a =
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            function o() {
                this.constructor = e;
            }
            n(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o()));
        }),
    r = function (e, t, o, n) {
        var i,
            a = arguments.length,
            r = a < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, o)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, o, n);
        else
            for (var s = e.length - 1; s >= 0; s--)
                (i = e[s]) && (r = (a < 3 ? i(r) : a > 3 ? i(t, o, r) : i(t, o)) || r);
        return a > 3 && r && Object.defineProperty(t, o, r), r;
    };
Object.defineProperty(i, "__esModule", {value: !0});
var s = e("AssetsMap"),
    c = e("BundleNames"),
    l = e("GameData"),
    d = e("nodePoolManager"),
    u = cc._decorator,
    p = u.ccclass,
    h =
        (u.property,
        (function (e) {
            function t() {
                var t = (null !== e && e.apply(this, arguments)) || this;
                return (
                    (t.posList = []),
                    (t.blast1 = null),
                    (t.blast2 = null),
                    (t.blast3 = null),
                    (t.blast4 = null),
                    (t.blast5 = null),
                    (t.refresh_blast = []),
                    t
                );
            }
            return (
                a(t, e),
                (t.prototype.ShowBlast = function (e) {
                    for (var t = 0, o = 0, n = e.length; o < n; o++)
                        if (++t % 2 != 0) {
                            var i = e[o];
                            this.posList.push(cc.v2(i.x, i.y));
                        }
                }),
                (t.prototype.start = function () {
                    (this.blast1 = game.BundleManager.instance
                        .getBundle(c.default.Game)
                        .get(s.default.GameBundle.textures.assetsList.blast1, cc.SpriteFrame)),
                        (this.blast2 = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList.blast2, cc.SpriteFrame)),
                        (this.blast3 = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList.blast3, cc.SpriteFrame)),
                        (this.blast4 = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList.blast4, cc.SpriteFrame)),
                        (this.blast5 = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList.blast5, cc.SpriteFrame));
                }),
                (t.prototype.refreshMapRendering = function (e) {
                    for (
                        var t = this.node.convertToNodeSpaceAR(cc.v2(e.x, e.y)),
                            o = cc.rect(t.x, t.y, e.width, e.height),
                            n = 0,
                            i = this.refresh_blast.length;
                        n < i;
                        n++
                    ) {
                        var a = this.refresh_blast[n];
                        o.contains(cc.v2(a.x, a.y))
                            ? (a.getComponent(cc.Sprite).enabled = !0)
                            : (a.getComponent(cc.Sprite).enabled = !1);
                    }
                }),
                (t.prototype.update = function () {
                    if (l.default.instance.gameState == l.GameState.play && 0 != this.posList.length) {
                        var e = this.posList.shift(),
                            t = d.default.instance.getBlastNode();
                        t.setPosition(cc.v3(e.x, e.y)), (t.parent = this.node), this.refresh_blast.push(t);
                        var o = this;
                        cc.tween(t)
                            .call(function () {
                                t.getComponent(cc.Sprite).spriteFrame = o.blast1;
                            })
                            .delay(0.1)
                            .call(function () {
                                t.getComponent(cc.Sprite).spriteFrame = o.blast2;
                            })
                            .delay(0.1)
                            .call(function () {
                                t.getComponent(cc.Sprite).spriteFrame = o.blast3;
                            })
                            .delay(0.1)
                            .call(function () {
                                t.getComponent(cc.Sprite).spriteFrame = o.blast4;
                            })
                            .delay(0.1)
                            .call(function () {
                                t.getComponent(cc.Sprite).spriteFrame = o.blast5;
                            })
                            .delay(0.1)
                            .call(function () {
                                for (var e = 0, n = o.refresh_blast.length; e < n; e++)
                                    o.refresh_blast[e] == t && o.refresh_blast.splice(e, 1);
                                d.default.instance.delBlastNode(t);
                            })
                            .start();
                    }
                }),
                r([p], t)
            );
        })(cc.Component));
i.default = h;
